<?php
	require_once('includes/general.php');
    if(!tep_db_checkDb()) die('khong ket noi dc csdl');
    $content='';
                   
    $sql='select * from tbl_thu_vien';
    $kq=tep_db_query($sql);
   $content.='<div id="menu_left">
                <div class="menu_top"></div>
                <div class="menu_content">
                    <h2>Thư Viện Spirulina</h2><ul class="menu">';
                
                while($item=tep_db_fetch_array($kq)){
                    $content.='<li><a href="?page=thuvien&amp;masanpham='.$item['id'].'&amp;mode=detail">'.$item['tieu_de'].'</a>
                    </li>';
                }
$content.='</ul>
             </div>
             <div class="menu_bottom"></div>
            </div>';
            
            $content.='<div id="main_content">';
                $sql2='select * from tbl_thu_vien ';
                $kq2=tep_db_query($sql2);
                $item2=tep_db_fetch_array($kq2);
                $content.='<h1> ..:::.. '.$item2['tieu_de'].' ..:::.. </h1>
                <div class="mota_chitietsanpham">'.$item2['mo_ta_chi_tiet'].'</div>';
                
            $content.='</div><div class="clear"></div>
        
        ';
  if(isset($_GET['mode']) &&$_GET['mode']=='detail'){
    $sql='select * from tbl_thu_vien';
    $kq=tep_db_query($sql);
   $content='<div id="menu_left">
                <div class="menu_top"></div>
                <div class="menu_content">
                    <h2>Thư Viện Spirulina</h2>
                    <ul class="menu">
                ';
                
                while($item=tep_db_fetch_array($kq)){
                    $content.='<li><a href="?page=thuvien&amp;masanpham='.$item['id'].'&amp;mode=detail">'.$item['tieu_de'].'</a>
                    </li>';
                }
            

$content.='     </ul>
             </div>
             <div class="menu_bottom"></div>
            </div>';
     $content.=' <div id="center_sanpham"> 
       
           ';
                 $masanpham=$_GET['masanpham'];
                $sql1='select * from tbl_thu_vien where id='.$masanpham;
                $kq1=tep_db_query($sql1);
                 while($item1=tep_db_fetch_array($kq1)){ 
               $content.='
                    <h1> ..:::.. '.$item1['tieu_de'].' ..:::.. </h1>
                   <div class="mota_chitietsanpham">'.$item1['mo_ta_chi_tiet'].'</div>';
                    
                   }  
            $content.='
            
        </div>';
  }      
      
  $content.=' ';
   echo $content;
?>